package Preview.meituan;

import java.util.Scanner;

public class Main3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        // if (s.equals("acca")) {
        //     System.out.println("aaaa");
        // } else if (s.equals("abcde")) {
        //     System.out.println("abcba");
        // } else {
        //     System.out.println(s);
        // }
        StringBuilder sb = new StringBuilder(s);
        int size = s.length();
        int maxReviseCnt = 2;
        int firstLoc = 0;
        for (int i = 0,j = size - 1;i < j;i++,j--) {
            if (sb.charAt(i) != sb.charAt(j)) {
                char t = '0';
                if (sb.charAt(i) < sb.charAt(j)) {
                    t = sb.charAt(i);
                } else {
                    t = sb.charAt(j);
                }
                sb.setCharAt(i, t);
                sb.setCharAt(j, t);
                if (--maxReviseCnt > 0) {
                    firstLoc = i;
                }
            } else if (maxReviseCnt == 2 && sb.charAt(i) != 'a' && firstLoc == 0) {
                firstLoc = i;
            }
        }
        if (maxReviseCnt > 0) {
            sb.setCharAt(firstLoc, 'a');
            sb.setCharAt(sb.length() - firstLoc - 1, 'a');
        }
        System.out.println(sb.toString());
    }
}
